package banque;

import java.util.Iterator;
import java.util.Set;

public class StandardAccount extends Compte{
	Client client;
	
	int penalityAmount = 5;
	
	
	public StandardAccount(){
		super();
		
	}
	
	public StandardAccount(Client client){
		super();
		this.client = client;
	}
	
	public int getPenalityAmount(){
		return penalityAmount;
		
	}
	
	public void setPenalityAmount(int penalityAmount){
		this.penalityAmount = penalityAmount;
	}
	
	public void calculerSolde(){
		Iterator<Operation> iter = getListeoperations().iterator();
		while(iter.hasNext()){
			Operation op = iter.next();
			switch(op.getType()){
			case Operation.CREDIT:	
				solde+=op.getMontant();
				break;
			case Operation.DEBIT:
				solde-=op.getMontant();
				break;
			default:
				break;
			}
			
		}
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}
}
